Telegram Group & Telegram Channel
Пакеты

Пакет — это, грубо говоря, папка с Python модулями. Помимо разделения проекта по частям, пакеты нужны для создания пространства имен, чтобы работать с модулями через точку, как в примере на картинке. 

При импорте from package import * будут подключены либо все модули и объекты модуля __init__.py, либо то, что находится в переменной __all__ в том же модуле __init__.py.

Еще примечателен файл __init__.py, который раньше был обязателен для создания пакетов. Но с версии Python 3.3 его необходимость пропала. Однако его функциональность на этом не заканчиваются.

#модули #пакеты



tg-me.com/python_academy/619
Create:
Last Update:

Пакеты

Пакет — это, грубо говоря, папка с Python модулями. Помимо разделения проекта по частям, пакеты нужны для создания пространства имен, чтобы работать с модулями через точку, как в примере на картинке. 

При импорте from package import * будут подключены либо все модули и объекты модуля __init__.py, либо то, что находится в переменной __all__ в том же модуле __init__.py.

Еще примечателен файл __init__.py, который раньше был обязателен для создания пакетов. Но с версии Python 3.3 его необходимость пропала. Однако его функциональность на этом не заканчиваются.

#модули #пакеты

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/619

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

The global forecast for the Asian markets is murky following recent volatility, with crude oil prices providing support in what has been an otherwise tough month. The European markets were down and the U.S. bourses were mixed and flat and the Asian markets figure to split the difference.The TSE finished modestly lower on Friday following losses from the financial shares and property stocks.For the day, the index sank 15.09 points or 0.49 percent to finish at 3,061.35 after trading between 3,057.84 and 3,089.78. Volume was 1.39 billion shares worth 1.30 billion Singapore dollars. There were 285 decliners and 184 gainers.

Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.Python Academy from ye


Telegram Python Academy
FROM USA